/*
 * @Author: your name
 * @Date: 2021-11-03 16:28:17
 * @LastEditTime: 2021-11-03 17:32:53
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \react-qunaer\src\components\Header\index.js
 */
import React from 'react'
import PropTypes from 'prop-types'
import './header.css'

export default function Header(props) {
  const {goBack, title} = props
  return (
    <div className="header">
      <div className="header-back" onClick={goBack}>
        <svg width="42" height="42">
          <polyline
            points="25,13 16,21 25,29"
            stroke="#fff"
            strokeWidth="2"
            fill="none"
          />
        </svg>
      </div>
      <h1 className="header-title">{title}</h1>
    </div>
  )
}

// eslint-disable-next-line react/no-typos
Header.propTypes = {
  goBack: PropTypes.func.isRequired,
  title: PropTypes.string.isRequired
}
